package co.edu.uniandes.intercon.core.model;

import java.io.Serializable;

public class P2PMessage implements Serializable {

	private Object request;
	
	private EMessageType type;
	private BaseDto applicationDto;
	private Exception exception;
	private Object response;
	
	public P2PMessage(BaseDto applicationDto, EMessageType type) {
		this.applicationDto = applicationDto;
		this.type = type;
	}
	
	public Object getRequest() {
		return request;
	}

	public void setRequest(Object request) {
		this.request = request;
	}

	public Object getResponse() {
		return response;
	}

	public void setResponse(Object response) {
		this.response = response;
	}

	public Exception getException() {
		return exception;
	}
	
	public void setException(Exception exception) {
		this.exception = exception;
	}

	
	
	public P2PMessage(){}
	
	public EMessageType getType() {
		return type;
	}

	public BaseDto getApplicationDto() {
		return applicationDto;
	}

	public boolean isSuccessResponse() {
		return exception==null;
	}
}
